package com.tudouji.project.organization.service.impl;

import java.util.List;

import com.tudouji.common.utils.SecurityUtils;
import com.tudouji.project.permission.domain.FlowPermissionAssignDO;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tudouji.project.organization.mapper.OrganizationMapper;
import com.tudouji.project.organization.domain.Organization;
import com.tudouji.project.organization.service.IOrganizationService;

/**
 * 组织管理Service业务层处理
 * 
 * @author tudouji
 * @date 2020-12-28
 */
@Service
public class OrganizationServiceImpl implements IOrganizationService 
{
    @Autowired
    private OrganizationMapper organizationMapper;

    /**
     * 查询组织管理
     * 
     * @param guid 组织管理ID
     * @return 组织管理
     */
    @Override
    public Organization selectOrganizationById(String guid)
    {
        return organizationMapper.selectOrganizationById(guid);
    }

    /**
     * 查询组织管理列表
     * 
     * @param organization 组织管理
     * @return 组织管理
     */
    @Override
    public List<Organization> selectOrganizationList(Organization organization)
    {
        return organizationMapper.selectOrganizationList(organization);
    }

    /**
     * 新增组织管理
     * 
     * @param organization 组织管理
     * @return 结果
     */
    @Override
    public int insertOrganization(Organization organization)
    {
        return organizationMapper.insertOrganization(organization);
    }

    /**
     * 修改组织管理
     * 
     * @param organization 组织管理
     * @return 结果
     */
    @Override
    public int updateOrganization(Organization organization)
    {
        return organizationMapper.updateOrganization(organization);
    }

    /**
     * 批量删除组织管理
     * 
     * @param guids 需要删除的组织管理ID
     * @return 结果
     */
    @Override
    public int deleteOrganizationByIds(String[] guids)
    {
        return organizationMapper.deleteOrganizationByIds(guids);
    }

    /**
     * 删除组织管理信息
     * 
     * @param guid 组织管理ID
     * @return 结果
     */
    @Override
    public int deleteOrganizationById(String guid)
    {
        return organizationMapper.deleteOrganizationById(guid);
    }

    @Override
    public List<Organization> getOrgs(Integer type) {

        Organization per=new Organization();
        if (type != null){
            per.setType(type);
        }
        return organizationMapper.getOrgs(per);
    }

    @Override
    public Organization selectOrganizationByAutoId(Long orgId) {
        return organizationMapper.selectOrganizationByAutoId(orgId);
    }

}
